$(document).ready(function(){
	$('a.generate-print').on('click',function(e){
		e.preventDefault();
		var url = $(this).attr('href');

		$("#msgDialog").dialog('option','width',400);
		$("#msgDialog").dialog('option','title','Generate Rosters.');
        $("#msgDialog").dialog('option', 'buttons', {
        "Cancel" : function() {
				$(this).dialog("close");
            }
        });

        var form = '';
        	form += '<form id="delete_student_form" action="'+ url +'" method="post" target="_blank">';
        	form += '<label class="label label-inverse">How many students per column?</label>';
        	form += '<input type="text" name="number_of_students" required>';
        	form += '<br>';
        	form += '<input type="submit" name="generate_roster" value="Continue print." id="print" class="btn btn-info">';
        	form += '</form>';
        $("#msgDialog > div.content").html(form);
        $("#msgDialog > p").html("Please define how many students to divide per block/section.");
        $("#msgDialog").dialog("open");
	});
});